﻿<%@ Page Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/MainContent.Master"
    Inherits="System.Web.Mvc.ViewPage<MShop.Core.Domain.Product>" %>

<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
    <script type="text/javascript" src="/js/swfupload/swfupload.js"></script>
    <script type="text/javascript" src="/js/swfupload/handlers.js"></script>
    <script type="text/javascript">
    var swfu;
    window.onload = function () {
        swfu = new SWFUpload({
            // Backend Settings
            upload_url: "/admin/upload/index/<%=ViewContext.RouteData.Values["id"] %>",
            post_params: {
                "ASPSESSID": "<%=ViewData["SessionId"] %>"
            },

            // File Upload Settings
            file_size_limit: "2 MB",
            file_types: "*.jpg;*.png;*gif",
            file_types_description: "JPG 图片",
            file_upload_limit: "<%=ViewData["maxlimit"] %>",    // Zero means unlimited

            // Event Handler Settings - these functions as defined in Handlers.js
            //  The handlers are not part of SWFUpload but are part of my website and control how
            //  my website reacts to the SWFUpload events.
            file_queue_error_handler: fileQueueError,
            file_dialog_complete_handler: fileDialogComplete,
            upload_progress_handler: uploadProgress,
            upload_error_handler: uploadError,
            upload_success_handler: uploadSuccess,
            upload_complete_handler: uploadComplete,

            // Button settings
            button_image_url: "/images/XPButtonNoText_160x22.png",
            button_placeholder_id: "spanButtonPlaceholder",
            button_width: 160,
            button_height: 22,
            button_text: '<span class="button">选择要上传的图片<span class="buttonSmall"></span></span>',
            button_text_style: '.button { text-align:center;font-family: Helvetica, Arial, sans-serif; font-size: 14px;border:solid 1px #000; } .buttonSmall { font-size: 12px;border:solid 1px #000; }',
            button_text_top_padding: 1,
            button_text_left_padding: 5,

            // Flash Settings
            flash_url: "/js/swfupload/flash/swfupload.swf", // Relative to this file

            custom_settings: {
                upload_target: "divFileProgressContainer"
            },

            // Debug Settings
            debug: false
        });
    }
    </script>
</asp:Content>
<asp:Content ID="changePasswordContent" ContentPlaceHolderID="MainContent" runat="server">
    <div id="content">
        <div id="fullBox">
            <div id="formOutBox">
                <div id="formTitle">
                    <div class="formTitleCard_c">
                        上传更多图片</div>
                    <div class="formTitlRight">
                        <img src="/Content/back.png" width="16" height="16" border="0" align="middle" style="margin-right: 3px;" />
                    </div>
                </div>
                <div id="formBox">
                    你可以最多上传<%=ViewData["maxlimit"]%>张JPG格式图片,图片大小只能为2MB以下，每种商品最多上传10张图片。
                    <input type="button"   value="返回" class="btn" onclick="location.href='<%=Url.Action("Edit","Product",new{id=Model.Id,actiontype = 1 ,cid=Model.CId}) %>';" />
                    <% using (Html.BeginForm())
                       { %>
                    <div id="swfu_container" style="margin: 10px 10px;">
                        <div>
                        </div>
                        <div>
                            <span id="spanButtonPlaceholder"></span>
                        </div>
                        <div id="divFileProgressContainer" style="height: 75px;">
                        </div>
                        <div id="thumbnails">
                        </div>
                    </div>
                    <% } %>
                </div>
            </div>
        </div>
</asp:Content>
